<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use App\Models\LocalOrderList;

class CheckSMSSendStatus implements ShouldQueue
{
    use Queueable;
    public $billCode;

    /**
     * Create a new job instance.
     */
    public function __construct($billCode)
    {
        //
        $this->billCode = $billCode;
        $this->onQueue("sendsms");
    }

    /**
     * Execute the job.
     */
    public function handle(): void
    {
        //
        $order = LocalOrderList::where('billCode', $this->billCode)->first();
        if (!empty($order)) {
            Log::debug("======================同城派送-送达短信通知");
            Log::debug('运单号:' . $this->billCode);
            Log::debug('成功');
            Log::debug("======================同城派送-送达短信通知");
        } else {
            Log::debug("======================同城派送-送达短信通知");
            Log::debug('运单号:' . $this->billCode);
            Log::debug('失败');
            Log::debug("======================同城派送-送达短信通知");
        }
    }
}
